package com.woniuxy.cloud.carl.order.client;

import com.woniuxy.cloud.carl.order.client.param.AddOneOrderParam;
import com.woniuxy.cloud.carl.order.client.param.AddOrderParam;
import com.woniuxy.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient(contextId = "orderManageClient",path = "order", name = "order")
public interface OrderManageClient {

    @PostMapping("oneOrder")
    public Result<String> createOneOrder(@RequestBody AddOneOrderParam param);

    @PostMapping("orderByCart")
    public Result createOrderByCart(@RequestBody AddOrderParam param);

    @GetMapping("cancelOrder")
    public Result cancelOrder(@RequestParam("orderNum") String orderNum, @RequestParam("userId") Long userId);

    @GetMapping("pay/{num}")
    public Result payOrder(@PathVariable(value = "num") String num);

    @PostMapping("payCallback/{num}")
    public Result payCallback(@PathVariable(value = "num") String num); //支付成功

    @PutMapping("order_item_id")
    public Result setCommentFlag(@RequestBody Long orderItemId); //评论接口


    @PutMapping("useCode")
    public Result useCode(@RequestBody Long orderItemId);

    @PutMapping("receive")
    public Result receive(@RequestBody Long deliveryId);




}
